// Agent default in project Jasim

/* Plans */


/*--- failure recovery plans ----*/
@frp_satisfies[atomic]
+fail_satisfies(A, G): true
	<-
	ra_add(goal, "not (pr_satisfied", A, G, ")");
	.send(jasim, achieve, check_replan(satisfies(A,G))).

@frp_passes[atomic]
+fail_passes(A1, A2, G): true
	<-
	ra_add(goal, "not (pr_passes", A1, A2, G, ")");
	ra_remove(fact, can_provide(A2, G));
	.send(jasim, achieve, check_replan(passes(A1,A2,G))).

@frp_and_decomposes2[atomic]
+fail_and_decomposes2(A, G, G1, G2): true
	<-
	ra_add(goal, "not (pr_decomposes2", G, G1, G2, ")");
	ra_add(goal, "not (pr_satisfied", A, G1, ")");
	ra_add(goal, "not (pr_satisfied", A, G2, ")");
	.send(jasim, achieve, check_replan(and_decomposes2(A,G,G1,G2))).

@frp_and_decomposes3[atomic]
+fail_and_decomposes3(A, G, G1, G2, G3): true
	<-
	ra_add(goal, "not (pr_decomposes3", G, G1, G2, G3, ")");
	ra_add(goal, "not (pr_satisfied", A, G1, ")");
	ra_add(goal, "not (pr_satisfied", A, G2, ")");
	ra_add(goal, "not (pr_satisfied", A, G3, ")");
	.send(jasim, achieve, check_replan(and_decomposes3(A,G,G1,G2,G3))).
